package com.dlc.shop.seckill.common.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dlc.shop.bean.model.SeckillStockPointSku;
import com.dlc.shop.seckill.common.dao.SeckillStockPointSkuMapper;
import com.dlc.shop.seckill.common.service.SeckillStockPointSkuService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 *
 * @author FrozenWatermelon
 * @date 2023-11-23 15:32:01
 */
@Service
@AllArgsConstructor
public class SeckillStockPointSkuServiceImpl extends ServiceImpl<SeckillStockPointSkuMapper, SeckillStockPointSku> implements SeckillStockPointSkuService {

    private final SeckillStockPointSkuMapper seckillStockPointSkuMapper;

    @Override
    public SeckillStockPointSku getBySeckillStockPointSkuId(Long seckillStockPointSkuId) {
        return seckillStockPointSkuMapper.getBySeckillStockPointSkuId(seckillStockPointSkuId);
    }

    @Override
    public void update(SeckillStockPointSku seckillStockPointSku) {
        seckillStockPointSkuMapper.update(seckillStockPointSku);
    }

    @Override
    public void deleteById(Long seckillStockPointSkuId) {
        seckillStockPointSkuMapper.deleteById(seckillStockPointSkuId);
    }

    @Override
    public void batchSave(List<SeckillStockPointSku> stockPointDTOList) {
        if (CollectionUtil.isEmpty(stockPointDTOList)) {
            return;
        }
        seckillStockPointSkuMapper.batchSave(stockPointDTOList);
    }
}
